package org.nanyuan.forum.controller;



import org.nanyuan.forum.common.AppResult;
import org.nanyuan.forum.exception.ApplicationException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test")
public class TestController {


    @RequestMapping("/hello")
    public String hello() {
        return "hello,spring boot...";
    }


    @RequestMapping("/exception")
    public AppResult testException() throws Exception {
        throw new Exception("这是一个测试Exception...");
    }

    @RequestMapping("/applicationException")
    public AppResult applicationException() {
        throw new ApplicationException("这是一个测试ApplicationException...");
    }
}
